package cn.broadsense.thrid.param;

import cn.broadsense.common.exception.ServiceException;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 设备变焦
 *
 * @author pengxin
 * @date 2022-08-10 11:31
 */
@ApiModel("设备变焦")
@Data
public class VideoCloudFocusParam extends BaseParam {
    private static final long serialVersionUID = -7921398591840892556L;

    @ApiModelProperty("云台聚焦相对变化值，范围-1~1 焦距+ 焦距")
    private Double change;
    @ApiModelProperty("通道编码")
    private String channelId;
    @ApiModelProperty("速度")
    private Integer speed;

    @Override
    public void checkParam() {
        if (StrUtil.isBlank(getChannelId())) {
            throw new ServiceException("通道编码不能为空");
        }
        if (null == getChange()) {
            throw new ServiceException("云台聚焦相对变化值不能为空");
        }
    }

    @Override
    public Class getResultClass() {
        return String.class;
    }
}
